﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnkyoController
{
    public class ReceiverCollection : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private ObservableCollection<string> receivers = new ObservableCollection<string>();
        public ObservableCollection<string> Receivers 
        {
            get
            {
                return receivers;
            }
        }

        public ReceiverCollection()
        {
        }

        public void Add(string newReceiver)
        {
            receivers.Add(newReceiver);

            NotifyPropertyChanged("Receivers");
        }

        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}
